<template>
  <div class="children">
    <button @click="FatherFun()">sun组件调用father组件方法2——简写</button>
    <div></div>
    <button @click="childFun()">sun组件调用father组件方法2——非简写</button>
  </div>
</template>
<script>
export default {
  name: "Children",
  props: {
    FatherFun: {
      type: Function,
      default: null
    }
  },
  methods: {
    childFun() {
      if (this.FatherFun) {
        this.FatherFun();
      }
    }
  }
};
</script>
<style lang="scss" scoped>
.children{
    button{
        margin-top: 20px;
    }
}
</style>